package com.zxc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxc.dao.CstLevelMapper;
import com.zxc.entity.CstLevel;
import com.zxc.service.CstLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CstLevelServiceImpl extends ServiceImpl<CstLevelMapper, CstLevel> implements CstLevelService {

    @Autowired
    private CstLevelMapper cstLevelMapper;


    @Override
    public List<CstLevel> selectAll() {
        List<CstLevel> cstLevelList = cstLevelMapper.selectList(new QueryWrapper<>());
        return cstLevelList;
    }

    @Override
    @Transactional
    public int saveCstLevel(CstLevel cstLevel) {
        int result = cstLevelMapper.insert(cstLevel);
        return result;
    }
}
